home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
e
/
mailinglists
/
amigae.0793july.archive
/
000020_crash!kirk.safb.af.mil!BWILLS_Sun, 11 Jul 93 09:40:51 PST.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-26
|
3KB
Received: by bkhouse.cts.com (V1.16/Amiga)
id AA00000; Sun, 11 Jul 93 09:40:51 PST
Received: from kirk.safb.af.mil by crash.cts.com with smtp
(Smail3.1.28.1 #15) id m0oF2pk-00016tC; Sun, 11 Jul 93 07:56 PDT
Message-Id: <m0oF2pk-00016tC@crash.cts.com>
Date: 11 Jul 93 09:52:00 CST
From: "Barry D. Wills" <BWILLS@kirk.safb.af.mil>
To: "amigae" <amigae@bkhouse.cts.com>
Subject: Processor Ids
Here's something I cooked up to help my startup-sequence in deciding which
startup to run based on the processor I booted with (Derringer-030 uses 68000
and 68030). It also checks for FPU and MMU just for the heck of it.
----- CUT HERE ----------------------------------------------------------------
/*
IdentifyProcessors - For AmigaDOS V1.3 (and higher?)
Author: Barry Wills
Program to place the values of the current processor ids in the
environment. The following environment variables will receive the
appropriate string values, and can be used in scripts:
$CPU - 68040
68030
68020
68010
68000
$FPU - 68882
68881
NIL (usage: IF "$FPU" eq "")
$MMU - 68851
NIL (usage: IF "$MMU" eq "")
Configuration Notes (add your config and results here)
~~~~~~~~~~~~~~~~~~~
KS1.3: - 68000/""/"" == correct values reflected
68030/68881/68851 == (Derringer-030) MMU not recognized
Rights and Restrictions
~~~~~~~~~~~~~~~~~~~~~~~
This program is hereby placed in the public domain. The reader/user of
this program assumes all risk.
*/
MODULE 'exec/types'
MODULE 'exec/execbase'
MODULE 'dos/dos'
DEF ver = NIL
PROC main ()
DEF execBase : PTR TO execbase,
attnFlag,
processor,
fh
ver := 'VER$: PROCs V1.0 (10JUL93)'
execBase := execbase
attnFlag := execBase.attnflags
/*-----------------*/
/* Check CPU type. */
/*-----------------*/
IF attnFlag AND AFF_68040
processor := '68040'
ELSEIF attnFlag AND AFF_68030
processor := '68030'
ELSEIF attnFlag AND AFF_68020
processor := '68020'
ELSEIF attnFlag AND AFF_68010
processor := '68010'
ELSE
processor := '68000'
ENDIF
IF (fh := Open ('ENV:CPU', NEWFILE)) = NIL THEN RETURN RETURN_FAIL
Write (fh, processor, 5)
Close (fh)
/*----------------*/
/* Check for FPU. */
/*----------------*/
IF attnFlag AND AFF_68881
processor := '68881'
ELSEIF attnFlag AND AFF_68882
processor := '68882'
ELSE
processor := NIL
ENDIF
IF (fh := Open ('ENV:FPU', NEWFILE)) = NIL THEN RETURN RETURN_FAIL
IF processor THEN Write(fh, processor, 5)
Close (fh)
/*----------------*/
/* Check for MMU. */
/*----------------*/
IF attnFlag AND AFF_68851_MMU
processor := '68851'
ELSE
processor := NIL
ENDIF
IF (fh := Open ('ENV:MMU', NEWFILE)) = NIL THEN RETURN RETURN_FAIL
IF processor THEN Write (fh, processor, 5)
Close (fh)
ENDPROC 0